import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * Entry is HTTP Server entry, each socket create a thread
 * @author hui.wang
 *
 */
public class Entry {
	
	public static void main(String[] args){
		try{
			//Listen at the specified port.
			ServerSocket server = new ServerSocket(8080);
			for(;;){
				//Accept an incoming connection
				Socket client = server.accept();
				//Create a Service Thread to serve
				Service service = new Service(client);
				service.start();
			}
		} catch(IOException e) {
			System.err.println("Error binding the specified port.");
		}
	}

}
